/**  
 * @Title: GameCommentValidator.java
 * @Package com.limit.control.admin.validate
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-4-8 上午10:06:40
 * @version V1.0
 */ 
package com.limit.control.admin.validate;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;
import com.limit.model.GameComment;

/** 
 * <br/>
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-4-8 上午10:06:40 
 * @version V1.0
 */

public class GameCommentValidator extends Validator {

	/* 
	 * 
	 * @param c 
	 * @see com.jfinal.validate.Validator#validate(com.jfinal.core.Controller) 
	 */
	@Override
	protected void validate(Controller c) {
		this.validateRequired("gameComment.game_id", "game_idError", "关联的游戏ID不能为空！");
		this.validateRequired("gameComment.title", "titleError", "标题不能为空！");
		this.validateRequired("gameComment.content", "contentError", "内容不能为空！");
//		this.validateRequired("gameComment.grade", "gradeError", "评分不能为空！");
		this.validateRequired("gameComment.is_check", "is_checkError", "审核结果不能为空！");
	}

	/* 
	 * 
	 * @param c 
	 * @see com.jfinal.validate.Validator#handleError(com.jfinal.core.Controller) 
	 */
	@Override
	protected void handleError(Controller c) {
		c.keepModel(GameComment.class);
		c.render("game_comment_view.html");
	}

}
